﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using control.Biz;
namespace control.Dal
{
    class DalChuDe
    {
        internal static List<BizChuDe> GetAll()
        {
            //List<BizChuDe> result = new List<BizChuDe>();
            var cds = from cd in DalCommon.SachDB.ChuDes
                      select new BizChuDe(cd.IDChuDe, cd.TenChuDe);
            return cds.ToList<BizChuDe>();
        }

        internal static BizChuDe GetByMa(int _MaCD)
        {
            var cds = from cd in DalCommon.SachDB.ChuDes
                      where cd.IDChuDe==_MaCD
                      select new BizChuDe(cd.IDChuDe, cd.TenChuDe);
            return cds.FirstOrDefault<BizChuDe>();
        }
    }
}
